package org.eclipselabs.egf.portfolio.task.scala.test.bool

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.lang.Boolean

class BoolEquals extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var first = taskProductionContext.getInputValue("firstBooleanEquals", classOf[Boolean])
		var second = taskProductionContext.getInputValue("secondBooleanEquals", classOf[Boolean])
		var firstTrue = taskProductionContext.getInputValue("firstBooleanTrueEquals", classOf[Boolean])
		var secondTrue = taskProductionContext.getInputValue("secondBooleanTrueEquals", classOf[Boolean])
		if(first == firstTrue && second == secondTrue){
			EGFCorePlugin.getDefault().logWarning("Test Passed")
		}
		else
			EGFCorePlugin.getDefault().logError("Test Failed")
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}